﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
/// <summary>
/// 开发者:耿卫星
/// 功能:实现会员,和时间统计销售情况.
/// 时间:2009-1-14
/// </summary>
public partial class Controls_MemberStatisticsControl : System.Web.UI.UserControl
{
    public event RepeaterCommandEventHandler ItemCommand;
    public List<string> Selected
    {
        get
        {
            List<string> l = new List<string>();
            foreach (RepeaterItem item in rptMemberStatisticsList.Items)
            {
                CheckBox cb = item.FindControl("chkChoose") as CheckBox;
                if (cb != null && cb.Checked)
                {
                    HiddenField fld = item.FindControl("hfORDERDOC") as HiddenField;
                    if (fld != null)
                    {
                        string id = fld.Value;
                        l.Add(id);
                    }
                }
            }
            return l;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    public void Bind(DataTable l)
    {
        rptMemberStatisticsList.DataSource = l.DefaultView;
        rptMemberStatisticsList.DataBind();
    }

    protected void rptORDERDOC_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (ItemCommand != null)
            ItemCommand(source, e);
    }
    protected void rptORDERDOC_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        //{
        //    string odid = ((HiddenField)e.Item.FindControl("hfORDERDOC")).Value;
        //}
       
    }
}
